using System;
using System.Collections.Generic;
using System.Text;
using System.Windows.Forms;

namespace WindowsUserControl.UIUpdateWrapper
{
    /// <summary>
    /// 
    /// </summary>
    public class StatusBarUpdator
    {
        StatusStrip statusStrip;
        ToolStripStatusLabel statusBar;
        string message;

        /// <summary>
        /// 
        /// </summary>
        /// <param name="strip"></param>
        /// <param name="status"></param>
        /// <param name="msg"></param>
        public StatusBarUpdator(StatusStrip strip, ToolStripStatusLabel status, string msg)
        {
            this.statusStrip = strip;
            this.statusBar = status;
            this.message = msg;
            this.statusStrip.Invoke(new MethodInvoker(this.RefreshStatusMessage));
        }

        private void RefreshStatusMessage()
        {
            this.statusBar.Text = this.message;
        }
    }
}
